package IO;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;


public class DeleteAgentGUI extends JFrame {
	
	private JTextField Name;
	private JTextField Userid;
	private JPasswordField passwordField;
	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void DeleteAgent() {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					DeleteAgentGUI frame = new DeleteAgentGUI();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public DeleteAgentGUI() {
		super("Delete Agent");
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setBounds(100, 100, 320,165);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		GridBagLayout gbl_contentPane = new GridBagLayout();
		gbl_contentPane.columnWidths = new int[]{0, 0, 0, 0};
		gbl_contentPane.rowHeights = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0};
		gbl_contentPane.columnWeights = new double[]{0.0, 0.0, 1.0, Double.MIN_VALUE};
		gbl_contentPane.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, Double.MIN_VALUE};
		contentPane.setLayout(gbl_contentPane);
		
		JLabel lblEnterName = new JLabel("Enter Name");
		GridBagConstraints gbc_lblEnterName = new GridBagConstraints();
		gbc_lblEnterName.insets = new Insets(0, 0, 5, 5);
		gbc_lblEnterName.anchor = GridBagConstraints.EAST;
		gbc_lblEnterName.gridx = 1;
		gbc_lblEnterName.gridy = 1;
		contentPane.add(lblEnterName, gbc_lblEnterName);
		
		Name = new JTextField();
		Name.setText("");
		GridBagConstraints gbc_Name = new GridBagConstraints();
		gbc_Name.insets = new Insets(0, 0, 5, 0);
		gbc_Name.fill = GridBagConstraints.HORIZONTAL;
		gbc_Name.gridx = 2;
		gbc_Name.gridy = 1;
		contentPane.add(Name, gbc_Name);
		Name.setColumns(10);
		
		JLabel lblUserid = new JLabel("UserID");
		GridBagConstraints gbc_lblUserid = new GridBagConstraints();
		gbc_lblUserid.insets = new Insets(0, 0, 5, 5);
		gbc_lblUserid.anchor = GridBagConstraints.EAST;
		gbc_lblUserid.gridx = 1;
		gbc_lblUserid.gridy = 3;
		contentPane.add(lblUserid, gbc_lblUserid);
		
		Userid = new JTextField();
		GridBagConstraints gbc_Userid = new GridBagConstraints();
		gbc_Userid.insets = new Insets(0, 0, 5, 0);
		gbc_Userid.fill = GridBagConstraints.HORIZONTAL;
		gbc_Userid.gridx = 2;
		gbc_Userid.gridy = 3;
		contentPane.add(Userid, gbc_Userid);
		Userid.setColumns(10);
		
		JLabel lblPassword = new JLabel("Password");
		GridBagConstraints gbc_lblPassword = new GridBagConstraints();
		gbc_lblPassword.insets = new Insets(0, 0, 5, 5);
		gbc_lblPassword.anchor = GridBagConstraints.EAST;
		gbc_lblPassword.gridx = 1;
		gbc_lblPassword.gridy = 5;
		contentPane.add(lblPassword, gbc_lblPassword);
		
		passwordField = new JPasswordField();
		GridBagConstraints gbc_passwordField = new GridBagConstraints();
		gbc_passwordField.insets = new Insets(0, 0, 5, 0);
		gbc_passwordField.fill = GridBagConstraints.HORIZONTAL;
		gbc_passwordField.gridx = 2;
		gbc_passwordField.gridy = 5;
		contentPane.add(passwordField, gbc_passwordField);
		
		JPanel SubmitPanel = new JPanel();
		GridBagConstraints gbc_SubmitPanel = new GridBagConstraints();
		gbc_SubmitPanel.fill = GridBagConstraints.BOTH;
		gbc_SubmitPanel.gridx = 2;
		gbc_SubmitPanel.gridy = 7;
		contentPane.add(SubmitPanel, gbc_SubmitPanel);
		GridBagLayout gbl_SubmitPanel = new GridBagLayout();
		gbl_SubmitPanel.columnWidths = new int[]{0, 0, 0, 0, 0, 0, 0};
		gbl_SubmitPanel.rowHeights = new int[]{0, 0};
		gbl_SubmitPanel.columnWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
		gbl_SubmitPanel.rowWeights = new double[]{0.0, Double.MIN_VALUE};
		SubmitPanel.setLayout(gbl_SubmitPanel);
		
		JButton btnSubmit = new JButton("Submit");
		GridBagConstraints gbc_btnSubmit = new GridBagConstraints();
		gbc_btnSubmit.insets = new Insets(0, 0, 0, 5);
		gbc_btnSubmit.gridx = 2;
		gbc_btnSubmit.gridy = 0;
		SubmitPanel.add(btnSubmit, gbc_btnSubmit);
		
		final JButton btnCancel = new JButton("Cancel");
		GridBagConstraints gbc_btnCancel = new GridBagConstraints();
		gbc_btnCancel.gridx = 5;
		gbc_btnCancel.gridy = 0;
		SubmitPanel.add(btnCancel, gbc_btnCancel);
		
		btnCancel.addActionListener(
				new ActionListener()
				{
					public void actionPerformed(ActionEvent event) 
					{
						if(event.getSource()==btnCancel)
						{
							dispose();
						}
					}
				
				});
		
	}

}
